package com.lagou.base;


import com.alibaba.fastjson.JSONObject;

//success fail
public enum StatusCode {
    SUCCESS("success",0),FAIL("fail",0);
    private  String message;
    private  int code;

    StatusCode(){}
    StatusCode(String message, int code) {
        this.message = message;
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    @Override
    public String toString() {
        //{"mag";"success","status";0}
        //{"mag";"fail";"status";1}
        JSONObject object = new JSONObject();
        object.put("mse",message);

        object.put("status",code);
        return object.toString();
    }
}
